<p class="Head1"><help:link Id="66608">CBool Function [Runtime]</help:link></p>
<p class="Paragraph">Converts a string comparison or numeric comparison to a boolean expression, or converts a single numeric expression to a boolean expression.</p>
<p class="Paragraph">Expression1, Expression2 : Any string or numeric expressions to be compared. If the expressions match, the <span class="T1">CBool</span> function returns <span class="T1">True</span>; otherwise, <span class="T1">False</span> will be returned.</p>
<p class="Paragraph">Number :Any numeric expression to be converted. If the expression equals 0, <span class="T1">False</span> will be returned. If a value other than 0 is assigned to the function, <span class="T1">True</span> will be returned.</p>
<p class="Paragraph">The following example uses the <span class="T1">CBool</span> function to evaluate the value returned by the <span class="T1">Instr</span> function. The function proofs if the word <span class="T1">and</span> is found in a sentence entered by the user.</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleCBool</p>
<p class="PropText">Dim sText As String</p>
<p class="PropText">sText = InputBox("Please enter a short sentence:")</p>
<p class="PropText">REM Proof if the word »and« appears in the sentence.</p>
<p class="PropText">REM Instead of the command line</p>